<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition template="/private/template/default_layout.xhtml">
            <ui:define name="titulo">Alterar senha</ui:define>
            
            <ui:define id="alterar_senha_define" name="content">
                <h:form id="alterar_senha_form">
                    <center>
                        <br/> <br/><br/><br/><br/><br/><br/><br/>
                        <p:panel id="alterar_senha_panel" header="Alteração de Senha" style="width: 525px">
                            <div id="" align="left">
                                <h:panelGrid id="alterar_senha_grid" columns="3">
                                    <h:outputText value="Senha atual:"/>
                                    <p:inputText id="senha_atual" value="#{alterarSenhaManagedBean.senhaAtual}" 
                                                 validator="#{alterarSenhaManagedBean.validarSenhaAtual}"/>
                                    <h:message id="message_senha_atual" for="senha_atual" style="color: red"/>
                                    <h:outputText value="Nova senha:"/>
                                    <p:password id="nova_senha" value="#{alterarSenhaManagedBean.novaSenha}"  required="true" 
                                                requiredMessage="Campo obrigatório!" minLength="3" feedback="true"
                                                strongLabel="Forte" weakLabel="Fraca" promptLabel="Por favor digite uma senha" 
                                                goodLabel="Boa"/>
                                    <h:message id="message_nova_senha" for="nova_senha" style="color: red"/>
                                    <h:outputText value="Repetição da nova senha:"/>
                                    <p:password id="repeticao_nova_senha" value="#{alterarSenhaManagedBean.repeticaoNovaSenha}" 
                                                validator="br.uel.ati.validator.repeticaoSenha" required="true" 
                                                requiredMessage="Campo obrigatório!" minLength="3" feedback="false"/>
                                    <h:message id="message_repeticao_nova_senha" for="repeticao_nova_senha" style="color: red"/>
                                </h:panelGrid>
                                <h:panelGrid id="alterar_senha_grid_button" columns="2">
                                    <p:commandButton id="alterar_senha_confirmar" value="Alterar" style="width: 90px" 
                                                     action="#{alterarSenhaManagedBean.alterarSenha}" ajax="false"
                                                     update="message_senha_atual,message_nova_senha,message_repeticao_nova_senha"/>
                                    <p:commandButton id="cancelar" value="Cancelar" style="width: 90px" 
                                                     action="#{alterarSenhaManagedBean.limpar}" ajax="false"/>
                                </h:panelGrid>
                            </div>
                        </p:panel>
                    </center>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

